<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
  <meta charset="UTF-8">
  <title>玄奘之路-为我征2代言</title>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="format-detection" content="email=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <link rel="stylesheet" href="css/style.css"/>
</head>
<body>

<section class="app-red" data-bg="img/bg2.jpg">
  <div class="container-red">
    <input type="text" class="c-input1" title="名称" placeholder="名称"/>
    <a href="javascript:;" class="c-btn" title="查询"></a>
    <input type="number" class="c-input2" title="号码" placeholder="0"/>
    <a href="javascript:;" class="share" title="分享到盆友圈"></a>
  </div>
</section>

<div class="share-box">
  <img src="img/share.png" alt="分享"/>
</div>

<script>
(function(){
  // 点击显示分享提示
  var btn = document.querySelector('.share'),
      box = document.querySelector('.share-box');
  btn.addEventListener('touchstart',function(){
    box.style.display = 'block';
  });
  box.addEventListener('touchstart',function(){
    box.style.display = 'none';
  });

  // 图片预加载
  var image = new Image();
  image.src = document.querySelector('.app-red').getAttribute('data-bg');
  image.onload = function(){
    document.querySelector('.app-red').style.backgroundImage = 'url('+ image.src +')';
  };

  // 禁止选择
  var bodyStyle = document.body.style;
  bodyStyle.mozUserSelect = 'none';
  bodyStyle.webkitUserSelect = 'none';

  // @module rem 改变页面大小 初始320
  var docEl = document.documentElement,
      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
      recalc = function() {
        docEl.style.fontSize = 20*(docEl.clientWidth/320)+'px';
      };
  window.addEventListener(resizeEvt, recalc, false);
  document.addEventListener('DOMContentLoaded', recalc, false);
})();
</script>
</body>
</html>
